package com.ihelp.rest.mis.platform.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.ihelp.rest.mis.platform.service.OnlinetimeService;
import com.ihelp.rest.mis.pojo.Onlinetime;
import com.ihelp.rest.utils.HtmlUtil;

@Controller
@RequestMapping("/system/onlinetime")
public class OnlinetimeController {
	@Autowired
	private OnlinetimeService onlinetimeService;
	
	@RequestMapping("onlinetimeList.do")
	public String onlinetimeList(HttpServletRequest request){
		return "system/onlinetime/onlinetimeList";
	}
	
	@RequestMapping("jsonOnlinetimePageList.do")
	public void jsonOnlinetimePageList(HttpServletResponse response, Onlinetime queryCondition,int page,int rows,String sort, String order){
		String json = this.onlinetimeService.findOnlinetimePage(queryCondition, page, rows, sort, order);
		HtmlUtil.writerJson(response, json);
	}
	
	@RequestMapping("doSaveOnline.do")
	public void doSaveOnline(HttpServletResponse response, Onlinetime onlinetime){
		String result = this.onlinetimeService.saveOnlinetime(onlinetime);
		HtmlUtil.sendDirectToClient(response,result);
	}
	
	@RequestMapping("doDelOnline.do")
	public void doDelOnline(HttpServletResponse response, String ids){
		String result = this.onlinetimeService.delOnlinetime(ids);
		HtmlUtil.sendDirectToClient(response,result);
	}
}
